package ui;

import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;
import java.util.List;

import core.SongRecord;

public class SongSelection implements Transferable {
	
	public static DataFlavor flavor = new DataFlavor(java.util.List.class, "SongRecord List");
	private static DataFlavor[] compatibleFlavors = { flavor };
	
	private List<SongRecord> data;
	
	public SongSelection(List<SongRecord> data) {
		this.data = data;
	}

	public Object getTransferData(DataFlavor flavor)
			throws UnsupportedFlavorException, IOException {
		return data;
	}

	public DataFlavor[] getTransferDataFlavors() {
		return compatibleFlavors;
	}

	public boolean isDataFlavorSupported(DataFlavor flavor) {
		return (flavor == SongSelection.flavor);
	}

}
